<%@page import="com.mmy.domain.sys.TSysUser"%>
<%@page import="com.mmy.domain.constzone.TConstZone"%>
<%@page import="com.mmy.domain.line.TLineBase"%>
<%@page import="com.mmy.domain.sys.TSysOrg"%>
<%@page import="com.mmy.domain.line.TLinePlace"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<% TSysUser tSysUser = (TSysUser) session.getAttribute("tSysUser");%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<jsp:include page="/WEB-INF/jsp/includeb.jsp"></jsp:include>
<script type="text/javascript" src="js/jsp/back/surroud/updateSurroud.js"></script>
</head>
<body>
	<div id="off-canvas-container" class="off-canvas-container">
		<jsp:include page="/WEB-INF/jsp/BackHeader.jsp"></jsp:include>
		<main class="at-padding-large-bottom"> <article> <header
			class="bg-light at-padding-large-top at-padding-large-bottom at-margin-large-bottom">
		<div class="page-header container">
			<div class="row">
				<div class="span-5 col">
					<h1>线路管理</h1>
				</div>
			</div>
		</div>
		</header> <section class="container"> <!-- 修改线路基信息 -->
		<div class="information" >
			<form class="info-form" id="updateForm">
				<input id="type" value="${type}" type="hidden">
				<h4 class="info-h4">
					<i class="fa fa-caret-right" aria-hidden="true"></i>修改近郊游信息
				</h4>
				<div class="input-container">
					<table class="info-table">
						<tr>
							<th><label for="LineName">线路名称</label></th>
							<td colspan="5"><input type="text" id="LineName"
								name="LineName" value="${tLineBase.getLineName() }"
								required="required" /><span class="mustWrite">*</span> <input
								type="hidden" name="LineID" id="LineID" value="${tLineBase.getLineID()}"
								readonly="readonly" /></td>
						</tr>
						<tr>
							<th><label for="LineZoneID">所属区域</label></th>
							<td colspan="5">
							<c:choose>
							<c:when test="${type == 3 }">
							
								<select class="select-height" id="LineZoneID" name="ZoneContinentID" required="required">
							<c:forEach var="lstConstZoneContinent" items="${lstConstZoneContinent}">
								<option value="${lstConstZoneContinent.getZoneID()}">${lstConstZoneContinent.getZoneName()}</option>
								</c:forEach>
								</select>
							<select class="select-height" id="ZoneID"  name="ZoneID" required="required">
							<c:forEach var="lstConstZoneCountriess" items="${lstConstZoneCountriess}">
								<option value="${lstConstZoneCountriess.getZoneID()}">${lstConstZoneCountriess.getZoneName()}</option>
								</c:forEach>
								</select>
								<span class="mustWrite">*</span>
								
							</c:when>
							<c:otherwise>
								<select class="select-height"
								  name="ZoneProvinceID" emptyOption="false"
									onchange="changeSelect(this,'getLevel4','level3','City')">
										<%-- <option value="${province.iZoneID}">${province.cZoneName}</option> --%>
										<c:forEach var="lstConstZoneProvince"
											items="${lstConstZoneProvince}">
											<option value="${lstConstZoneProvince.getZoneID()}" <c:if test="${lstConstZoneProvince.getZoneID() == province.iZoneID}"> selected="selected"</c:if> >${lstConstZoneProvince.getZoneName()}</option>
										</c:forEach>
								</select> <select class='select-height input-select-vlign City' name='ZoneCityID'
									emptyOption='false'
									onchange="changeSelect(this,'getLevel8','level4','ZoneID')">
										<%-- <option value="${city.iZoneID }">${city.cZoneName}</option> --%>
										<c:forEach var="lstConstZoneCity" items="${lstConstZoneCity}">
												<option value="${lstConstZoneCity.getZoneID()}" <c:if test="${lstConstZoneCity.getZoneID() == city.iZoneID}"> selected="selected"</c:if> >${lstConstZoneCity.getZoneName()}</option>
										</c:forEach>
								</select> <select class='select-height input-select-vlign ZoneID' id="LineZoneID"
									name="ZoneID" emptyOption='false'>
										<%-- <option value="${district.iZoneID}">${district.cZoneName}</option> --%>
										<c:forEach var="lstConstZoneDistrict" items="${lstConstZoneDistrict}">
												<option value="${lstConstZoneDistrict.getZoneID()}" <c:if test="${lstConstZoneDistrict.getZoneID() == district.iZoneID}"> selected="selected"</c:if>>${lstConstZoneDistrict.getZoneName()}</option>
										</c:forEach>
								</select>
							</c:otherwise>
							
							</c:choose>
							</td>
						</tr>
						<tr>
							<th><label for="LinePlace">集合地点与时间</label></th>
							<td colspan="5">
								<datalist id="PlaceNameList">
								<c:forEach var="lstLinePlace" items="${lstLinePlace}">
									<option>${lstLinePlace.getPlaceName()}</option>
								</c:forEach>
								</datalist>
								<div id="placeTime">
								<c:forEach var="lstPlaceTime" items="${lstPlaceTime}" varStatus="status">
									<div id="place${status.index}">
									地点：<input id="placeName${status.index}" type="text" list="PlaceNameList" value="${lstPlaceTime.cPlaceID}"/>
									时间：<input id="placeTime${status.index}" type="text" maxlength="128" value="${lstPlaceTime.cPlaceTime}" />
									<input type="button" class="btn" value="删除" onclick="removePlace(${status.index})">
									</div>
								</c:forEach>
								</div>
								 <input type="button" class="btn" value="增加"  onClick="updatePlaceTables()">
							</td>
						</tr>
						
						<tr>
							<th><label for="LineOwn">自费项目</label></th>
							<td colspan="5"><textarea id="LineOwn" name="Own"
									required="required">${tLineBase.getOwn() } </textarea><span
								class="mustWrite">*</span></td>
						</tr>
						<tr>
							<th><label for="LineTips">温馨提示</label></th>
							<td colspan="5"><textarea id="LineTips" name="Tips"
									required="required">${tLineBase.getTips() }</textarea><span
								class="mustWrite">*</span></td>
						</tr>
						<tr>
							<th><label for="LineStandard">接待标准</label></th>
							<td colspan="5"><textarea id="LineStandard" name="Standard"
									required="required">${tLineBase.getStandard() }</textarea><span
								class="mustWrite">*</span></td>
						</tr>
						<tr>
							<th><label for="LineExplain">接待说明</label></th>
							<td colspan="5"><textarea id="LineExplain" name="Explain"
									required="required">${tLineBase.getExplain() }</textarea><span
								class="mustWrite">*</span></td>
						</tr>

						<tr>
							<th><label for="LineMemo">备注</label></th>
							<td colspan="5"><textarea id="LineMemo" name="Memo">${tLineBase.getMemo()}</textarea>
							</td>
						</tr>
					</table>
					<h4 class="info-h4">
						<i class="fa fa-caret-right" aria-hidden="true"></i>修改线路行程信息
					</h4>
					<div class="input-container">
						

						<table id="tripTable" class="info-table">
							<tbody>
								<tr>
									<td colspan="7">详情 <input type="hidden" id="LineID"
										name="LineID" value="${iLineID }" /></td>
									<td>操作</td>
								</tr>
							</tbody>
							<c:forEach items="${lstLineTrip}" var="lstLineTrip"
								varStatus="status" begin="0">
								<tbody id="tbody${status.index }">
									<tr>
<th rowspan="11"><label for="TripDay${status.index }">第</label>
<input type="number" id="TripDay${status.index }" class="daywidth" name="Day" size="2"  value="${lstLineTrip.getDay() }" maxlength="2" readonly/>
<label for="TripDay${status.index }">天</label></th>
<th ><label for="TripAddress${status.index }">地点</label></th>
<td ><input type="text" id="TripAddress${status.index }" name="Address" value="${lstLineTrip.getAddress() }" maxlength="128" required="required"/><span class="mustWrite">*</span></td>
<th ><label for="TripStay${status.index }">住宿</label></th>
<td ><input type="text" id="TripStay${status.index }" name="Stay" value="${lstLineTrip.getStay() }" maxlength="128" required="required"/><span class="mustWrite">*</span></td>
<th ><label for="TripMeal${status.index }">含餐</label></th>
<td ><input type="text" id="TripMeal${status.index }" name="Meal" value="${lstLineTrip.getMeal() }" maxlength="64" required="required"/><span class="mustWrite">*</span></td>
<td rowspan="11"><input type="button"  class="btn" onclick="removeTr(${status.index })" value="删除"></td> 
</tr>
<tr>
<th ><label for="TripTrip${status.index }">具体行程</label></th>
<td colspan="5"><textarea id="TripTrip${status.index }" name="Trip" maxlength="512" required="required"> ${lstLineTrip.getTrip() }</textarea><span class="mustWrite">*</span></td>
</tr>
<tr>
<th rowspan="4"><label for="TripHotel1${status.index }">酒店照片</label></th>
<td><label for="TripHotel1${status.index }">图片1:</label></td>
<td colspan="4" ><input type="file" id="TripHotel1${status.index }" name="HotelPath1" value="${lstLineTrip.getHotelPath1() }"/></td>
</tr>
<tr>
<td><label for="TripHotel2${status.index }">图片2:</label></td>
<td colspan="4" ><input type="file" id="TripHotel2${status.index }" name="HotelPath2"  value="${lstLineTrip.getHotelPath2() }"/></td>
</tr>
<tr>
<td><label for="TripHotel3${status.index }">图片3:</label></td>
<td colspan="4" ><input type="file" id="TripHotel3${status.index }" name="HotelPath3"  value="${lstLineTrip.getHotelPath3() }"/></td>
</tr>
<tr>
<td><label for="TripHotel4${status.index }">图片4:</label></td>
<td colspan="4" ><input type="file" id="TripHotel4${status.index }" name="HotelPath4"  value="${lstLineTrip.getHotelPath4() }"/></td>
</tr>
<tr>
<th rowspan="4"><label for="TripScenic1${status.index }">景点照片</label></th>
<td><label for="TripScenic1${status.index }">图片1:</label></td>
<td colspan="4" ><input type="file" id="TripScenic1${status.index }" name="ScenicPath1"  value="${lstLineTrip.getScenicPath1() }"/></td>
</tr>
<tr>
<td><label for="TripScenic2${status.index }">图片2:</label></td>
<td colspan="4" ><input type="file" id="TripScenic2${status.index }" name="ScenicPath2"  value="${lstLineTrip.getScenicPath2() }"/></td>
</tr>
<tr>
<td><label for="TripScenic3${status.index }">图片3:</label></td>
<td colspan="4" ><input type="file" id="TripScenic3${status.index }" name="ScenicPath3"  value="${lstLineTrip.getScenicPath3() }"/></td>
</tr>
<tr>
<td><label for="TripScenic4${status.index }">图片4:</label></td>
<td colspan="4" ><input type="file" id="TripScenic4${status.index }" name="ScenicPath4"  value="${lstLineTrip.getScenicPath4() }"/></td>
</tr>
<tr>
<td><label for="TripMemo${status.index }">备注:</label></td>
<td colspan="5" ><textarea id="TripMemo${status.index }" name="Memo" maxlength="256">${lstLineTrip.getMemo() }</textarea></td>
</tr>
								</tbody>
							</c:forEach>
						</table>
						<input type="button" id="btn_addtr" class="btn" value="增行" onClick="updateTripTables()">
						<center>
							<input type="button" class="btn" value="保存" onclick="saveUpdateLineBaseTrip()"/> 
							<input type="button" class="btn" value="返回" onclick="rehidder()" />
						</center>
					</div>
			</form>
		</div>
		</section> </article> </main>
		<jsp:include page="/WEB-INF/jsp/Footer.jsp"></jsp:include>
	</div>
	<jsp:include page="/WEB-INF/jsp/include2.jsp"></jsp:include>

</body>
</html>